<template>
    <ShowMessage>
        <template v-slot:left>
            <span>返回</span>
        </template>
        <template v-slot:center>
            <div>标题</div>
        </template>
        <template v-slot:right>
            <a href="#">登录</a>
        </template>
    </ShowMessage>
    <ShowMessage>
        <template v-slot:[position]>
            <a href="#">注册</a>
        </template>
    </ShowMessage>
    <button @click="position = 'left'">left</button>
    <button @click="position = 'center'">center</button>
    <button @click="position = 'right'">right</button>
</template>
<script>
import ShowMessage from './ShowMessage.vue'
export default {
    components: {
        ShowMessage
    },
    data() {
        return {
            position:"center"
        }
    }
}
</script>
<style scoped></style>